package com.kuqi.fragments;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;

import androidx.fragment.app.Fragment;

import com.bumptech.glide.Glide;
import com.kuqi.R;
import com.kuqi.WebActivity;

// 游戏界面
public class GameRecommendFragment extends Fragment {

    // 跟界面
    private View rootView;

    // 开始游戏加载
    private ImageView iv_background_game;
    private ImageButton ib_start_game;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_game, container, false);
        iv_background_game = rootView.findViewById(R.id.iv_background_game);
        // Glide.with(this).asGif().load(R.mipmap.game).into(iv_background_game);
        ib_start_game = rootView.findViewById(R.id.ib_start_game);
        ib_start_game.setOnClickListener(btJumpClick);
        return rootView;
    }


    /**
     * 点击跳转到可以游戏网页展现界面
     */
    View.OnClickListener btJumpClick = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getContext(), WebActivity.class);
            startActivity(intent);

            // 这是调用系统浏览器
            // Uri uri = Uri.parse(url);//url为你要链接的地址
            // Intent intent = new Intent(Intent.ACTION_VIEW，uri);
            // startActivity(intent);
        }
    };


}
